import java.util.Scanner;

abstract class Shape{
    abstract double area();
}
class Rectangle extends Shape{
    public double a;
    public double b;
    Rectangle(double a , double b){
        this.a = a;
        this.b = b;
    }
@Override
    double area() {
        return  a*b;
    }
}

class Circle extends Shape{
    public double r;
    Circle(double r) {
        this.r = r;
    }
    @Override
    double area(){
        return Math.PI*r*r;
    }
}

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请依次输入矩形10长，宽和圆的半径");
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double r = scanner.nextDouble();

        Shape a1 = new Rectangle(a,b);
        Shape a2 = new Circle(r);

        System.out.println("矩形的面积"+a1.area());
        System.out.println("圆形的面积"+a2.area());



    }
}
